<?php
if($_POST["btn_logar"] == "Entrar"){
    if(logar()){
        header("location:".$url);
    }
}
?>
<div id="login">
    <form action="" method="post">
        <label>Usuário </label>
        <input type="text" name="usuario"><br>
        <label style="margin-right: 12px">Senha </label>
        <input type="password" name="senha"><br>
        <input type="submit" name="btn_logar" value="Entrar">
    </form>
</div>